/**
 * @author nttdocomo
 */
define(function(require) {
	aries.klass('aries.util.Floating', aries.Class.extend({
		initialize:function(){
			me.floating = true;
		},
		/**
		 * Aligns this floating Component to the specified element
		 *
		 * @param {Ext.Component/Ext.Element/HTMLElement/String} element
		 * The element or {@link Ext.Component} to align to. If passing a component, it must be a
		 * component instance. If a string id is passed, it will be used as an element id.
		 * @param {String} [position="tl-bl?"] The position to align to
		 * (see {@link Ext.Element#alignTo} for more details).
		 * @param {Number[]} [offsets] Offset the positioning by [x, y]
		 * @return {Ext.Component} this
		 */
		alignTo : function(element, position, offsets) {

			// element may be a Component, so first attempt to use its el to align to.
			// When aligning to an Element's X,Y position, we must use setPagePosition which disregards any floatParent
			this.$el.css({position:'absolute'})
			this.$el.position($.extend({
				"of":element.$el || element
			},position))
			//this.setPagePosition(this.$el.getAlignToXY(element.$el || element, position, offsets));
			return this;
		}
	}))
})
